<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
    <div th:fragment="add">
        <!--添加GoodsCategory模态框-->
        <div id="modal-add-form" class="modal fade" aria-hidden="true">
            <div class="modal-dialog" style="width: 800px;">
                <div class="modal-content">
                    <div class="modal-body">
                        <div class="row">
                            <h3 class="m-t-none m-b">商品分类表添加</h3>
                            <div class="col-sm-12">
                                <div class="ibox float-e-margins">
                                    <div class="ibox-content">
                                        <form id="aform" method="post" class="form-horizontal" action="add"
                                              onsubmit="return checkAdd()">
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label class="col-sm-4 control-label">分类名称*
                                                        </label>
                                                        <div class="col-sm-8">
                                                            <input class="form-control" name="name" required type="text" maxlength="100"/>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label class="col-sm-4 control-label">排序*
                                                        </label>
                                                        <div class="col-sm-8">
                                                            <input class="form-control" name="paixu" required type="number"/>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label class="col-sm-4 control-label">上级分类</label>
                                                        <div class="col-sm-8">
                                                            <div class="input-group">
                                                                <select class="form-control select2" id="pid" onchange="cateschange(this.value,this)">
                                                                    <option value="">无</option>
                                                                    <option th:each="c:${cates}" th:value="${c.id}"
                                                                            th:text="${c.name}"></option>
                                                                </select>
                                                                <!--<input type="hidden" id="pidAdd" name="pid">-->
                                                                <!--<input type="text" placeholder="选择上级分类" id="pnameAdd"-->
                                                                       <!--class="input input-sm form-control" readonly>-->
                                                                <!--<span class="input-group-btn">-->
                                                                <!--<button type="button" class="btn btn-sm btn-white"-->
                                                                        <!--data-toggle="modal" href="#modal-select-form">-->
                                                                    <!--<i class="fa fa-plus"></i>选择</button>-->
                                                                <!--</span>-->
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label class="col-sm-4 control-label">分类类型</label>
                                                        <div class="col-sm-8">
                                                            <input class="form-control" name="type"
                                                                   type="text"/>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label class="col-sm-4 control-label">是否启用</label>
                                                        <div class="col-sm-8">
                                                            <input type="checkbox" class="js-switch" name="state" id="state-add" value="1">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-12">
                                                    <div class="form-group">
                                                        <label class="col-sm-2 control-label">图标地址</label>
                                                        <div class="col-sm-10">
                                                            <input id="mfile" name="mfile" type="file" class="file"/>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-4 col-sm-offset-2">
                                                    <button class="btn btn-primary" type="submit">保存内容</button>
                                                    <button data-toggle="modal" type="button" class="btn btn-white"
                                                            href="#modal-add-form">取消
                                                    </button>
                                                </div>
                                            </div>
                                            <input id="hidpic" name="pic" type="hidden" value="" />
                                            <input id="hidpname" name="pname" type="hidden" value="" />
                                            <input id="hidpid" name="pid" type="hidden" value="" />
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>